package com.qinggeng.framework.config.mq.impl;

import com.alibaba.fastjson.JSONObject;
import com.qinggeng.framework.config.mq.dto.MessageAssistDTO;
import com.qinggeng.framework.config.mq.dto.MessageAssistDTO;
import com.qinggeng.framework.config.mq.handle.MessageHandle;
import com.qinggeng.project.system.service.IAssistRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 吴鹏飞
 * @date 2020/11/20
 * 助力失败处理
 */
@Slf4j
@Component
public class AssistFailHandleImpl implements MessageHandle {
    @Autowired
    private IAssistRecordService assistRecordService;

    @Override
    public void handle(String msg) {
        MessageAssistDTO messageAssistDto = JSONObject.parseObject(msg, MessageAssistDTO.class);

        assistRecordService.updateAssistRecordForFail(messageAssistDto);
    }
}
